package com.study.design.pattern.pattern.behavioral.interpreter;

/**
 * @Author: gongsl
 * @Date: 2025-03-23 16:18
 */
public class SQLDemo {
    public static void main(String[] args) {
        SQLContext context = new SQLContext();
        context.put("name", "Alice");
        context.put("age", 30);
        context.put("department", "HR");

        SQLExpression condition = new AndExpression(
                new EqualsExpression("age", 30),
                new EqualsExpression("department", "HR")
        );

        System.out.println(condition.interpret(context)); // 输出true
    }
}
